<layout name="page" />
<block name="content">
	{:widget('page_header/adv_search',array('name'=>$folder_name))}
	<div id="adv_search" class="hidden">
		<form method="post" name="form_adv_search" id="form_adv_search">
			<div id="adv_search_header" class="row" style="">
				<h1 style="">高级搜索</h1>
				<i class="x1" class=""></i>
				<a class="btn btn-normal" id="submit_adv_search">搜索</a>
				<a class="btn btn-return" id="close_adv_search">关闭</a>
			</div>
			<div class="row" id="adv_search_body" >
				<div class="box col-6">
					<label class=" input-label" for="li_name">文件名：</label>
					<input  class="input" type="text" id="li_name" name="li_name" >
				</div>
				<div class="box col-6">
					<label class=" input-label" for="li_content">内容：</label>
					<input  class="input" type="text" id="li_content" name="li_content" >
				</div>
				<div class="box col-6">
					<label class="input-label" for="eq_user_name">登录人：</label>
					<input  class="input" type="text" id="eq_user_name" name="eq_user_name" >
				</div>
				<div class="box col-6">
					<label class="input-label">登录时间：</label>
					<input type="text" class="input-date" name="be_create_time" readonly="readonly"/>
					<i class="date-mid">-</i>
					<input type="text" class="input-date" name="en_create_time" readonly="readonly"/>
				</div>
			</div>
		</form>
	</div>
	<div class="operate-panel">
		<i class="mid"></i>
		<if condition="$auth->read">
			<a class="btn btn-normal" onclick="add()">发布任务</a>
		</if>
	</div>
	<div class="tab-box">
		<div class="tab-header">
			<a href="{:url('folder',array('fid'=>'all'))}" <if condition="$fid=='all'">class="active"</if>>所有任务</a>
			<a href="{:url('folder',array('fid'=>'sub'))}"  <if condition="$fid=='sub'">class="active"</if>>下属任务</a>
			<a href="{:url('folder',array('fid'=>'no_finish'))}"  <if condition="$fid=='no_finish'">class="active"</if>>我未完成</a>
			<a href="{:url('folder',array('fid'=>'finished'))}"  <if condition="$fid=='finished'">class="active"</if>>我已完成</a>
			<a href="{:url('folder',array('fid'=>'my_task'))}"  <if condition="$fid=='my_task'">class="active"</if>>我发布的</a>
			<a href="{:url('folder',array('fid'=>'my_assign'))}"  <if condition="$fid=='my_assign'">class="active"</if>>我指派的</a>
		</div>
	</div>
	<div class="sub">
		<div class="table">
			<ul>
				<li class="thead">
					<span class="w8 ">编号</span>
					<span class="w8 ">发起人</span>
					<span class="w12 x1"> 标题 </span>
					<span class="w20">指派给</span>
					<span class="w16">发起时间</span>
					<span class="w16">期望完成时间</span>
					<span class="w6 ">状态</span>
					<span class="w9 text-center">操作</span>
				</li>
				<if condition="empty($list)">
					<li class="no-data">
						没找到数据
					</li>
					<else/>
					<foreach name="list" val="task">
						<li class="tbody">
							<span class="w8 ">{$task.task_no}</span>
							<span class="w8 ">{$task.user_name}</span>
							<span class="w12 x1"> <a href="{:url('read','id='.$task['id'])}">{$task.name}</a> </span>
							<span class="w20">{:show_contact($task['executor'])}</span>
							<span class="w16">{:to_date($task['create_time'],'Y-m-d H:i')}&nbsp;</span>
							<span class="w16">{:substr($task['expected_time'],0,16)}&nbsp;</span>
							<span class="w6">{:status($task['status'],'task')}&nbsp;</span>
							<span class="w9 text-center">
								<if condition="($task['status'] == 30) and ($task['user_id'] == $user_id)">
									<a href="{:url('edit','id='.$task['id'])}">修改</a>&nbsp;<a href="{:url('del','id='.$task['id'])}">删除</a>
									<else/>
									<if condition="$auth->admin">
										<a href="{:url('edit','id='.$task['id'])}">修改</a>&nbsp;<a href="{:url('del','id='.$task['id'])}">删除</a>
									</if>
								</if></span>
						</li>
					</foreach>
				</if>
			</ul>
		</div>
		<if condition="!empty($list)">
			{$page}
		</if>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global'], function() {
			var fn = {
				add : function() {
					window.open("{:url('add')}", "_self");
				}
			};
			win_exp(fn);
			set_return_url(null);
		});
	</script>
</block>
